<script setup lang="ts">
import { ref, watch } from 'vue';

const p = defineProps<{ modelValue?: number, min?: number, max?: number, disabled?: boolean, step?: number }>()
const e = defineEmits(['change'])
const value = ref(p.modelValue)

watch(() => value.value, t => {
    e('change', t)
})

watch(() => p.modelValue, e => {
    value.value = e
})

</script>

<template>
    <ElSlider v-model="value" v-bind="p" @change="v => e('change', v)"></ElSlider>
</template>